home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2004 September
/
Chip_2004-09_cd1.bin
/
program
/
delphi
/
download
/
nastroje
/
97.mpth_10[1].exe
/
{app}
/
scripts
/
Enumerate Differences.mps
< prev
next >
Wrap
Text File
|
2003-10-17
|
1KB
|
70 lines
= show differences in a text box
INCLUDE 'def.mps'
option globalvars, 1
var count dword, len dword, blocklen dword, size text
var start dword ende dword curwnd text s1 dword msg text
count = compare_count
if count < 1
msgbox "No differences!", MB_ICONASTERISK:
end
endif
= calculate the maximum length of a diff block size
blocklen = 0
number_radix = 10
number_prefix = ''
number_suffix = ''
loop checkdifflen, count
loop line, count
showprogress 100,100
textbox msg, 'Comparison result'
end
= sub: check length of difference block
@@checkdifflen
len = textlen(text(compare_end(loop)-compare_start(loop)+1))
if len > blocklen
blocklen = len
endif
return
= sub:adjust size length
@@adj1
size = ' '+size
return
@@adjustsize
loop adj1, (blocklen - textlen(size))
return
= sub:write diff line
@@line
start = compare_start(loop)
ende=compare_end(loop)
number_radix = 10
number_prefix = ''
number_suffix = ''
concat msg ('Different block '+text(loop+1)+":\t")
number_radix = 16
number_prefix = '0x'
concat msg (text(start)+' - '+text(ende)+' (')
number_radix = 10
number_prefix = ''
s1 = ende - start + 1:size = text(s1): call adjustsize
if s1 == 1
concat msg (size + " Byte)\r\n")
else
concat msg (size + " Bytes)\r\n")
endif
showprogress count , loop
return